Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I want to make a straight table, like in the image (see attachment).
The problem is, I have no data in the straight table. All labels give number zero.
Can someone help me? Is something wrong with the variable or expressions?
Thanks in advance.
First I have make a variable in the variable overview:
Name variable:
vSetPreviousNMonth
The variable definition is:
PeriodID = {$(=Max(PeriodID) – $1)},
Year = ,
Quarter = ,
Month = ,
Period =
Then I have make a straight table: "Carrier Group" as the dimension.
And I have add the three expressions:
1. label: Current Month Flights,
expression:
Sum({$<$(vSetPreviousNMonth(0))>} [# Departures Performed])
2. label: Flights Previous Month
expression:
Sum({$<$(vSetPreviousNMonth(1))>} [# Departures Performed])
3. label: Flights Two Months Ago
expression:
Sum({$<$(vSetPreviousNMonth(2))>} [# Departures Performed])
Hi,
just check in Text Object that Your variable returning any value or not.
In text Object write
=vSetPreviousNMonth
Regards
Looks like you are using the Qlikview for Developer books, but I'm not sure what you actual issue is , as the screen shot looks to be correct when compare to my copy of the dashboard.
Andy
Hi Michel,
First of all what is Period ID ? Is it is date format or in month format ?
Assuming it is in month format:
Create a variable:
let vMonth=month(max(PeriodID))
Now in your straight chart:
Expression1:
sum({PeriodID={'$(=vMonth)'}[#Depature Performed])
Expression2:
sum({PeriodID={'$(=vMonth-1)'}[#Depature Performed])
Expression3:
sum({PeriodID={'$(=vMonth-2)'}[#Depature Performed])
Hope it works
Regards
KC
Try this,
In the load script add one column
num(AutoNumberHash256(year(Datecolumn) & month(Datecolumn)),'00') AS HashYearMonth,
1. label: Current Month Flights,
expression:
=Sum({<HashYearMonth= {$(=max(HashYearMonth))}>}[# Departures Performed])
1. label: Previous Month Flights,
expression:
=Sum({<HashYearMonth= {$(=max(HashYearMonth)-1)}>}[# Departures Performed])
3. label: Flights Two Months Ago
expression:
=Sum({<HashYearMonth= {$(<max(HashYearMonth)-2)}>}[# Departures Performed])