Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
QlikAngel
Partner - Creator
Partner - Creator

Set Analysis Issue

Hi,

I am using this code in chart

=(Count({$<TC_StockEntryDate={">=$(v_StockEntryDate)<=$(v_StockEndDate)"}>}DISTINCT TC_Stock_ID))

but value is not coming. if i use same logic in IF statement then output getting correctly.

please suggest..

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

You may need the date function, try with

=(Count({$<TC_StockEntryDate={">=$(=Date(v_StockEntryDate))<=$(=Date(v_StockEndDate))"}>}DISTINCT TC_Stock_ID))

View solution in original post

7 Replies
stigchel
Partner - Master
Partner - Master

You may need the date function, try with

=(Count({$<TC_StockEntryDate={">=$(=Date(v_StockEntryDate))<=$(=Date(v_StockEndDate))"}>}DISTINCT TC_Stock_ID))

MK_QSL
MVP
MVP

may be your variable date format is different than your TC_StockEntryDatedate format.

QlikAngel
Partner - Creator
Partner - Creator
Author

Nopes date formates are same..

jonathandienst
Partner - Champion III
Partner - Champion III

I suggest that you post your qvw or an example qvw that illustrates the problem, otherwise all the suggestions are guesses. Check these:

  • Do you variables return the values you are expecting?
  • Are they in the correct date format?

Also post the expression that does work. And try these:

=Count({$<TC_StockEntryDate={">=$(=v_StockEntryDate)<=$(=v_StockEndDate)"}>}DISTINCT TC_Stock_ID)

=Count({$<TC_StockEntryDate = {">=$(=Date(v_StockEntryDate))<=$(=Date(v_StockEndDate))"}>} DISTINCT TC_Stock_ID)

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
QlikAngel
Partner - Creator
Partner - Creator
Author

Thank you Piet Hein... its so simple...

stigchel
Partner - Master
Partner - Master

You're welcome Mayuri, one other tip for this kind of debugging is to leave the label of the expression blank. In a table it will display the evaluated expression in the header, so you can check whether the variables are giving you the expected values. In e.g. a line chart it will show in the mouse over.

LabelBlankVar.png

QlikAngel
Partner - Creator
Partner - Creator
Author

Yup got it .. it will really helpful