Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
In QlikView I wanted to design a table which displays a column if Year selected-1 is less then or equals to minimum Year available in my data set.
In my code I have the following:
DateRange:
LOAD
date(min(OrderDate)) as MinimumDate,
date(max(OrderDate)) as MaximumDate
Resident Facts;
LET $vMinDate = Date(MinimumDate,'DD-MM-YYYY');
In the Condition for the column expression:
(only(Year)-1) >= Year(date(MinimumDate))
correctly does not display this Column when I select the minimum Year in my data set.
However,
(only(Year)-1) >= Year(date(vMinDate))
and
(only(Year)-1) >= Year(date($vMinDate)),
and even (only(Year)-1) >= Year(date#(vMinDate,'DD-MM-YYYY'))
are always evaluated to True which is incorrect.
I would ideally like to drop table dateRange and utilise $vMinDate correctly in the Table Condition.
How can this be accomplished?
Thanks
Your variable-creation is wrong. Try it in this way:
DateRange:
LOAD
date(min(OrderDate)) as MinimumDate,
date(max(OrderDate)) as MaximumDate
Resident Facts;
LET vMinDate = peek('MinimumDate', 0, 'DateRange');
...
(only(Year)-1) >= Year($(vMinDate))
- Marcu
Your variable-creation is wrong. Try it in this way:
DateRange:
LOAD
date(min(OrderDate)) as MinimumDate,
date(max(OrderDate)) as MaximumDate
Resident Facts;
LET vMinDate = peek('MinimumDate', 0, 'DateRange');
...
(only(Year)-1) >= Year($(vMinDate))
- Marcu