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

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

data generation

hi all ,

can anyone tell me how to generate data think that I'm not having any source files

my requirement is lik generate data ,date,sunnydays such that atleast 40% days are sunnyin the year

autogenrate function I tried and generated date but not sunny days how can I generate data

5 Replies
sunny_talwar

Something like this?

Table:

LOAD Date(MakeDate(2014, 12, 31) + IterNo()) as Date,

  If(Rand() <= 0.40, 'Sunny Days', 'Cloudy Days') as DayTypeFlag

AutoGenerate 1

While IterNo() <= MakeDate(2015, 12, 31) - MakeDate(2014, 12, 31);

nareshthavidishetty
Creator III
Creator III
Author

I tried ur logic not working

LOAD
//RecNo() as S.no,

Date(MakeDate(2015,12,31)+recno()) as Date,
if(Rand()<=0.8,'Y','N') as sunny days

autogenerate 365

I couldn't understand this steps below

AutoGenerate 1

While IterNo() <= MakeDate(2015, 12, 31) - MakeDate(2014, 12, 31);



sunny_talwar

So this did not work? or did it?

LOAD
//RecNo() as S.no,

Date(MakeDate(2015,12,31)+recno()) as Date,
if(Rand()<=0.8,'Y','N') as sunny days

autogenerate 365

nareshthavidishetty
Creator III
Creator III
Author

‌not working

sunny_talwar

Does this not look right?

Capture.PNG

79.45% are Yes and 20.55% are No?