Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I'm quite new to qlik and hoping someone can help as im really stuck
I was trying to count the rows which matched two variables for some reason it is not working I'm using this currently
-
=Count({$(vLeaseCoUsed)={1},STATS_Wave=$(vWaveCurr)>} $(vLeaseCoUsed))
I'm assuming that $(vLeaseCoUsed) is a reference to a variable field, it should be anyway, in which case I would surround it by [ ], so [$(vLeaseCoUsed)]. If the field has a space in the name it will also work. Further, depending on what is in your variable you may need to use the = operator in the dollar sign expansion [$(=vLeaseCoUsed)]
Further your STATS_Wave=$(vWaveCurr) misses the {} brackets, so STATS_Wave={$(vWaveCurr)} and again you may need STATS_Wave={$(=vWaveCurr)} and depending on the contents even STATS_Wave={'$(=vWaveCurr)'}, so with ''
And data nibbler is right you are missing the < opening right after the {
Try this
=Count({<[$(=vLeaseCoUsed)]={'1'},STATS_Wave={'$(=vWaveCurr)'}>} [$(=vLeaseCoUsed)])
Hi Sarah,
you are missing an opening parenthesis < in your set_expression - right after the $, that's for one.
I'm really not sure myself about that vLeaseCoUsed - that is a variable? I have never tried to check the value of a variable in a set_expression.
I'm assuming that $(vLeaseCoUsed) is a reference to a variable field, it should be anyway, in which case I would surround it by [ ], so [$(vLeaseCoUsed)]. If the field has a space in the name it will also work. Further, depending on what is in your variable you may need to use the = operator in the dollar sign expansion [$(=vLeaseCoUsed)]
Further your STATS_Wave=$(vWaveCurr) misses the {} brackets, so STATS_Wave={$(vWaveCurr)} and again you may need STATS_Wave={$(=vWaveCurr)} and depending on the contents even STATS_Wave={'$(=vWaveCurr)'}, so with ''
And data nibbler is right you are missing the < opening right after the {
Try this
=Count({<[$(=vLeaseCoUsed)]={'1'},STATS_Wave={'$(=vWaveCurr)'}>} [$(=vLeaseCoUsed)])
By the way, if you want to check how this is interpreted, put the expression in a table and leave the expression label blank. That way the table header will display the expression but with the variable values evaluated, so you can check...
Genius it works ! thanks very much