Skip to main content
1-Visitor
Question

using data filter widget in the label chart

Mr/Mrs, now I have a question: 

this is my code: 

var query =
{
"filters": {
"type": "And",
"filters": [
{
"type": "EQ",
"fieldName": "Department",
"value": "Milk"
},
{
"type": "EQ",
"fieldName": "Kategory",
"value": "Production Volume"
},
{
"type": "EQ",
"fieldName": "SKU",
"value": "Whipping Cream 1000 ml"
}
]
}
};
var result = Resources["InfoTableFunctions"].RenameField({
t: Resources["InfoTableFunctions"].Aggregate({
t: me.QueryDataTableEntries({ maxItems: undefined,
query: query,
values:undefined,
source: undefined,
tags:undefined
}),
columns: 'value',
aggregates: 'SUM',
groupByColumns: 'year'
}),
from: "SUM_value",
to: "value"
});

clipboard_image_0.png

after that, I need do data filter using data filter widget and only show "2019" value. How can I edit this code?

but my value and target is different services. How to figure it out?

5 replies

22-Sapphire I

You could use a second stage filtering (or two services)

either first get data based on period selection then apply filter

or vice versa.

Translate
xiaoqw1-VisitorAuthor
1-Visitor

WeChat Screenshot_20191022101341.pngHi @PaiChung,

I try to apply this query into label chart. just change ESL 1000 ml to Whipping Cream 1000 ml.

 
 

but when I bind data filter widget, it is not working. Could you help me to figure it out?

Translate
22-Sapphire I

Data filter widget if working properly will supply the query in json that you bind to the input parameter of your service

and then filter changed would trigger the service.

perhaps you can log out the query input parameter in your service to see if it is working right?

Translate