Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Set Analysis with variables

Hello All,

We are trying to improvise a dashboard

Set Analysis expression looks like :

=(if(Match(

[Task Name],

'ABC',

'FMG',

'ELT',

),1,(if(Match([Task Name],'PF'),Count({<Distribution={1},[Task Category]={"main","sub"},[Task Name]-={'*Distribution*','*Tiina*','*new Report*',  '*housekeeping*'},Node_TS_Date={">=$(=Date(Today()-30))<$(=Date(Today()))"}, [Task Status]={'Completed', 'Warning','Failed'}>}Node_TS_Hour),2)))

I want to use variables in this for reuse purpose.

vCategory = [Task Category]={"main","sub"}

vTaskName = [Task Name]-={'*Distribution*','*Tiina*','*new Report*',  '*housekeeping*'}

vTaskStatus = [Task Status]={'Completed', 'Warning','Failed'}

vTaskOneDay Match([Task Name],'ABC','FMG','ELT',)


I am unable to create a set analysis expressions with these variables.


I have put this in one variable


vExpectedPCG = if(Match([Task Name],'PF'),Count({<Distribution={1},[Task Category]={"main","sub"},[Task Name]-={'*Distribution*','*Tiina*','*new Report*',  '*housekeeping*'},Node_TS_Date={">=$(=Date(Today()-30))<$(=Date(Today()))"}, [Task Status]={'Completed', 'Warning','Failed'}>}Node_TS_Hour),2)


=if((=$('vTaskOneDay')),1, $(=vExpectedPCG))


It is giving result for all except vTaskOneDay  part.


Can someone please help on this.



9 Replies
zhadrakas
Valued Contributor

Re: Set Analysis with variables

try to write it like this

'$(=vTaskOneDay)'

Not applicable

Re: Set Analysis with variables

Hello Tim,

     Tried with this expression : =if('$(=vTaskOneDay)',1, $(=vExpectedPCG)) No luck

VariableExpectedReloadCount is with above expression giving correct for all except ABC . count should be 1

Task NameReload datevariableExpected reloadCountsExpected reloadCounts
ABC2017-07-1821
XYZ2017-07-1822
PF2017-07-1833
Not applicable

Re: Set Analysis with variables

Hello All,

Variable :

vTaskOneDay 'ABC','FMG','ELT'

Partially it worked with

=(if(Match([Task Name],$(vTaskOneDay )),1, $(=vExpectedPCG)))

Still working on the other part.

vExpectedPCG = if(Match([Task Name],'PF'),Count({<Distribution={1},[Task Category]={"main","sub"},[Task Name]-={'*Distribution*','*Tiina*','*new Report*',  '*housekeeping*'},Node_TS_Date={">=$(=Date(Today()-30))<$(=Date(Today()))"}, [Task Status]={'Completed', 'Warning','Failed'}>}Node_TS_Hour),2)

Not applicable

Re: Set Analysis with variables


Hello All,


vEDXtaskname = 'PF','HG',SK'

trying to do but still getting error.

vExpectedPCG = if(Match([Task Name],$(=vEDXtaskname)),Count({<Distribution={1},[Task Category]={"main","sub"},[Task Name]-={'*Distribution*','*Tiina*','*new Report*',  '*housekeeping*'},Node_TS_Date={">=$(=Date(Today()-30))<$(=Date(Today()))"}, [Task Status]={'Completed', 'Warning','Failed'}>}Node_TS_Hour),2)


Regards,

Nisha

Re: Set Analysis with variables

How many task names you have?

Not applicable

Re: Set Analysis with variables

Hello Kushal,

As of now we have 3 in task names but can change in future.

Re: Set Analysis with variables

But in your expression looks like more,

'ABC',

'FMG',

'ELT',

'PF'

Not applicable

Re: Set Analysis with variables

Hello Kushal,

That way we have 100+ task, some run once a day, Some on EDX and some run twice.

We need to see the accuracy on what we are reloading based on the numbers it should be .

Hence task list may vary.

Regards,

Nisha

mjtaft2017
Contributor

Re: Set Analysis with variables

Hello Nisha

Maybe try what worked for your other variable when you put it in the expression and got desired result --

"Partially it worked with  =(if(Match([Task Name],$(vTaskOneDay ))  "

so this --

=if(Match([Task Name],$(vEDXtaskname)) ....

Community Browser