Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
Lets say i have this data:
DayNumber | Flag |
---|---|
2 | 1 |
8 | 1 |
9 | 1 |
If i make a barchart with a Count on flag, i will get 1 on each DayNumber.
But what if i want to show 1,2,3,4,5,6,7,8,9 on the x-asis even though 1,3,4,5,6,7 doesnt have any flag?
Ive tried to make an integertable and leftjoined it but that doesnt work
Have you got other day fields in your data model?
if yes use as below
Do as Below
Dimension Tab
Untick Suppress When Value is NULL
Tick Show All Values
Expression Tab
Tick Value on Data Points
Presentation Tab
Untick Suppress Zero Value
Tick Zero On Bars
Hope this helps..
And, if you don't have all the DayNumbers even in the master table, you can produce them in the front-end using continuous dimension axis(Axes tab) like attached sample.
What do i do if i want to link it to an integer table?
I can do like this:
IntTable:
RowNo() as ID
RowNo() as Int autogenerate(100);
left join (IntTable)
DayNumber:
DayNumber as Int,
Flag
But the problem is here, if i use Int as an dimension (i would get 100 values)
Is there any way to make the autogenerate generic so i can use the maxvalue in DayNumber (theni would only autogenerate up to the max value)
Yes, like:
b:
load * inline [
field1,field2
2,1
8,1
9,1
];
LOAD Max(field1) as Max Resident b;
Let vMax=Num(Peek('Max'));
Load
RowNo() as field1
AutoGenerate $(vMax);