Announcements
Meet our latest featured member Bruno! Drop a like and comment. READ ON
cancel
Showing results for
Did you mean:
Contributor II

## How to avoid incompleted week data to display

Hi,

I have day field which is no. of days from starting onwards in my data like 1,2,3,...

Here to get the no. of weeks divided the day with 7  and by using ceil i got but it displays week even for incomplete weeks  how to avoid those

ex.

field have 1 to 16

how to avoid 15 and 16 day values

1 Solution

Accepted Solutions
Specialist III

Probably better to set a variable in the load script, see sample data below:

Data2:
load * Inline [
D
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
];

MaxDayTemp:
load Max(D) as MaxDay
Resident Data2;

Let vMaxDay = Peek('MaxDay') - Mod(Peek('MaxDay'),7);
Drop Table MaxDayTemp;

Using the variable vMaxDay in Set Analysis

=Count({<D={"<=\$(vMaxDay)"}>}D)

Using the Mod function is Set Analysis

=Count({<D={"<=\$(=Max({1}D)-Mod(Max({1}D),7))"}>}D)

The suppress the zeros in the chart.

2 Replies
Specialist III

Probably better to set a variable in the load script, see sample data below:

Data2:
load * Inline [
D
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
];

MaxDayTemp:
load Max(D) as MaxDay
Resident Data2;

Let vMaxDay = Peek('MaxDay') - Mod(Peek('MaxDay'),7);
Drop Table MaxDayTemp;

Using the variable vMaxDay in Set Analysis

=Count({<D={"<=\$(vMaxDay)"}>}D)

Using the Mod function is Set Analysis

=Count({<D={"<=\$(=Max({1}D)-Mod(Max({1}D),7))"}>}D)

The suppress the zeros in the chart.

Contributor II
Author

Its working but when we have case like below it showing only for maximum one

load * Inline [
Country, D,Revenue
India,1,200
India,2,250
India,3,500
India,4
India,5
India,6
India,7
India,8
India,9
India,10
India,11
India,12
India,13
India,14
India,15
India,16

China,1

China,2

China,3

China,4

China,5

China,6

China,7

China,8

China,9

];

From above the above data i would like to build line chart for different line to each country by day and revenue

but your suggested condition working for only maximum days having country

Tags
Community Browser